package com.pox.guli.service.edu.controller;

import com.pox.guli.common.base.result.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author PoX21s
 * @Date: 2022/6/2 14:41
 * @Version 1.0
 */

//@CrossOrigin
@RestController
@RequestMapping("/user")
public class LoginController {

    @PostMapping("/login")
    public R login() {

        return R.ok().data("token", "admin");
    }

    @GetMapping("/info")
    public R info() {
        return R.ok()
                .data("roles", "[admin]")
                .data("name", "admin")
                .data("avatar", "https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
    }

    @PostMapping("/logout")
    public R logout() {
        return R.ok();
    }
}
